<?php
header("Pragma: no-cache");
header("Content-Type: text/xml; name=\"application.xml\"");

$v_application_id = 0;
if(isset($_REQUEST['hdn_application_id'])){
	$v_application_id = intval($_REQUEST['hdn_application_id']);
}

require_once('../isa-lib/nusoap/nusoap.php');
include "../isa-lib/isa-function/isa_public_function.php";
include "../db_const.php";
include "../isa-lib/adodb/adodb.inc.php";
include "../isa-lib/isa-function/prax.php";
include "export_import_function.php";

$ado_conn = &ADONewConnection("ado");
$db_name = str_replace('[','',$_ISA_DB_NAME);
$db_name = str_replace(']','',$db_name);

//Connect bang ADO
$conn_string = "Provider=SQLOLEDB; Data Source=" . $_ISA_SERVER_NAME . ";Initial Catalog='" . $db_name . "'; User ID=" . $_ISA_DB_USER . "; Password=" .$_ISA_DB_PASSWORD;
$ado_conn->Connect($conn_string) or die(_CONST_DB_CONNECT_ERROR);	

echo user_export_application($v_application_id);

header("Content-disposition: attachment; filename=application.xml");
?>